/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.z100h.supplychain.order.entity;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeeplus.common.utils.StringUtils;
import com.jeeplus.common.utils.excel.annotation.ExcelField;
import com.jeeplus.core.persistence.DataEntity;
import com.z100h.supplychain.core.RentType;

/**
 * 订单Entity
 * @author fyh
 * @version 2019-04-15
 */
public class Order extends DataEntity<Order> {

	private static final long serialVersionUID = 1L;

	private String orderNo; // 订单编号

	private Integer customerId; // 客户id

	private String customerName; // 客户名称

	private String contract; // 联系人

	private String phone; // 联系电话

	private String ownerId; // 归属人id

	private String salesName; // 销售员

	private Date createTime; // 创建时间

	private String orderState; // 订单状态

	private String beginCreateTime; // 开始 创建时间

	private String endCreateTime; // 结束 创建时间

	private String type;

	private String typeName;

	public Order() {
		super();
		this.setIdType(IDTYPE_AUTO);
	}

	public Order(String id) {
		super(id);
	}

	@ExcelField(title = "订单编号", align = 2, sort = 1)
	public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}

	@ExcelField(title = "客户id", align = 2, sort = 2)
	public Integer getCustomerId() {
		return customerId;
	}

	public void setCustomerId(Integer customerId) {
		this.customerId = customerId;
	}

	@ExcelField(title = "客户名称", align = 2, sort = 3)
	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	@ExcelField(title = "联系人", align = 2, sort = 4)
	public String getContract() {
		return contract;
	}

	public void setContract(String contract) {
		this.contract = contract;
	}

	@ExcelField(title = "联系电话", align = 2, sort = 5)
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@ExcelField(title = "归属人id", align = 2, sort = 6)
	public String getOwnerId() {
		return ownerId;
	}

	public void setOwnerId(String ownerId) {
		this.ownerId = ownerId;
	}

	@ExcelField(title = "销售员", align = 2, sort = 7)
	public String getSalesName() {
		return salesName;
	}

	public void setSalesName(String salesName) {
		this.salesName = salesName;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title = "创建时间", align = 2, sort = 8)
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@ExcelField(title = "订单状态", align = 2, sort = 9)
	public String getOrderState() {
		return orderState;
	}

	public void setOrderState(String orderState) {
		this.orderState = orderState;
	}

	public String getBeginCreateTime() {
		return beginCreateTime;
	}

	public void setBeginCreateTime(String beginCreateTime) {
		this.beginCreateTime = beginCreateTime;
	}

	public String getEndCreateTime() {
		return endCreateTime;
	}

	public void setEndCreateTime(String endCreateTime) {
		this.endCreateTime = endCreateTime;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		if (StringUtils.isNoneBlank(type)) {
			this.typeName = RentType.get(type).getName();
		}
		this.type = type;
	}

	public String getTypeName() {
		return typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

}